package com.xmall.mapper;

import com.xmall.bean.table.Coupon;
import com.xmall.bean.table.CouponUser;
import com.xmall.bean.table.CouponUserExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CouponUserMapper {
    long countByExample(CouponUserExample example);

    int deleteByExample(CouponUserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(CouponUser record);

    int insertSelective(CouponUser record);

    List<CouponUser> selectByExample(CouponUserExample example);

    CouponUser selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") CouponUser record, @Param("example") CouponUserExample example);

    int updateByExample(@Param("record") CouponUser record, @Param("example") CouponUserExample example);

    int updateByPrimaryKeySelective(CouponUser record);

    int updateByPrimaryKey(CouponUser record);

    /**
     * 根据couponId统计该用户拥有该类型优惠券的数量
     * @param couponId
     * @return
     */
    Integer queryCouponAmountByCouponId(@Param("couponId") Integer couponId);
}